import resolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import { terser } from 'rollup-plugin-terser'
import postcss from 'rollup-plugin-postcss'

export default {
  input: 'src/index.js',
  output: [
    {
      file: 'dist/index.es.js',
      format: 'es',
      sourcemap: true,
    },
    {
      file: 'dist/index.umd.js',
      format: 'umd',
      name: 'LaunchPodsSDK',
      sourcemap: true,
    }
  ],
  plugins: [
    resolve(),
    commonjs(),
    postcss({
      extract: true,      // 把 CSS 独立打包成文件
      minimize: true,
    }),
    terser(), // 压缩 JS
  ],
};